let allPrice = localStorage.getItem('allPrice')
let allEl = document.querySelector('.all')
let tanc = document.querySelector('.tanc')

// void(async function isFav() {
//     // let address = await axios({
//     //     method: 'post',
//     //     url: 'http://192.168.100.70:9527/api/user/getAdd',
//     //     data: {
//     //         "username": username
//     //     }
//     // })
//     let thisGoods = await axios({
//         method: 'post',
//         url: 'http://192.168.100.70:9527/api/data/getGoods',
//         data: {
//             "cartName": cartName
//         }
//     })
//     let goods = thisGoods.data.data.goods[0]

//     let cartImg = goods.cartImg
//     let cartDes = goods.cartDes
//     let cartSpc = goods.cartSpc
//     let cartPrice = goods.cartPrice
//     let cartType = goods.cartType
//     let _id = goods._id

    allEl.innerHTML = `
        <div>应付金额：</div>
        <div>￥${allPrice}</div>
    `

    tanc.innerHTML = `
    <div>付款详情</div>
    <div>￥${allPrice}</div>
    <div><span>支付方式</span><span><img src="../../img/icon/zsyh.png" alt="">招商银行行用卡(0535)</span></div>
    <a href="../WXL/zfcg.html">确认支付</a>
    `
// })()

let wx = document.querySelector('.wxzf')
let zfb = document.querySelector('.zfb')
let queren = document.querySelector('.out')

let back=document.querySelector('.back')
let wxZt = false;
let zfbZt = false
document.onclick = function (e) {
    e = e.target
    if (e == wx && wxZt == false) {
        wx.style.background = "red"
        wxZt = true
        zfb.style.background = "#fff"
        zfbZt = false
    }
    if (e == zfb && zfbZt == false) {
        zfb.style.background = "red"
        zfbZt = true
        wx.style.background = "#fff"
        wxZt = false
    }
    if (e == queren) {
        if (wxZt == false && zfbZt == false) {
            alert('请选择方式')
        } else {
            tanc.style.visibility = 'visible'
        }
    }
    if(e===back){
        // console.log(el);
        history.back()
    }
}
let m = document.querySelector(".time")
let time = 3600;
let n = setInterval(function () {
    time--;
    let one = parseInt(time / 3600)
    let two = parseInt((time % 3600) / 60)
    let there = parseInt(((time % 3600) % 60) % 60)
    m.innerHTML = `请及时支付，剩余支付时间：${one}时${two}分${there}秒`;
    if (time == 0) {
        clearInterval
    }
}, 1000);